﻿@{  
    Layout = "~/Views/Shared/_AppLayout.cshtml";
    List<Lion.WeiXin.Core.Models.DictionaryModel> categorys = ViewData["categorys"] as List<Lion.WeiXin.Core.Models.DictionaryModel>;
    List<Lion.WeiXin.Core.Models.ProductModel> topPros = ViewData["topPro"] as List<Lion.WeiXin.Core.Models.ProductModel>;
  
}
@section ChildPageJs {
    <script src="/Scripts/WeChat/WeChatProductIndex.js" type="text/javascript"></script>
    <style>
        div {
            font-size: 12px;
        }

        .nav {
            margin: 0px;
        }

            .nav li {
                float: left;
                margin: 10px;
                text-decoration: none;
                display: block;
                height: 30px;
                text-align: center;
                line-height: 30px;
            }

            .nav a {
                text-decoration: none;
                color: #333;
            }

        .clear {
            clear: both;
        }
    </style>
}

<div data-role="navbar">
    <ul>
        @foreach (Lion.WeiXin.Core.Models.DictionaryModel dic in categorys)
        {
            <li><a rel="external" href="/WeChatProduct/ProductList?typeId=@dic.AID">@dic.Dic_Value</a></li>
        }
    </ul>
</div>
<!--今日推荐-->
<h3 style="text-align: center;">推荐产品</h3>
<div class="ui-grid-b" >
    @for (int i = 0; i < 3; i++)
    {
        int sortNo = (i + 1) % 3;
        string className = "ui-block-a";
        if (sortNo == 1)
        {
            className = "ui-block-a";
        }
        else if (sortNo == 2)
        {
            className = "ui-block-b";
        }
        else 
        {
            className = "ui-block-c";
        }
        <div class="@className" style="padding:4px;">
            <a rel="external" href="/WeChatProduct/Details?ID=@topPros[i].AID" >
                <img alt="@topPros[i].Name" style="width: 100%;height:100%;border:1px solid #eee" src="@topPros[i].Image" />
            </a>
            <p style="font-weight: bold;text-align:center">@topPros[i].Name</p>
        </div>
    }
</div>

<!-- /navbar data-filter="true" data-filter-placeholder="搜索项目"-->
<ul id="lstProducts" data-role="listview" data-split-icon="gear" data-inset="true">
    <!--热销产品Top10-->
    <li data-role="list-divider">热销产品</li>
    @foreach (Lion.WeiXin.Core.Models.ProductModel item in ViewData["hotPro"] as List<Lion.WeiXin.Core.Models.ProductModel>)
    {
        <li data-name="@item.AID" data-icon="false">
            <a href="/WeChatProduct/Details?ID=@item.AID" rel="external" >
                <img src="@item.Image" style="width:100%;height:100%;margin:1px;">
                <p style="margin: 0px;">@item.Name </p>
                <p style="text-decoration: line-through;">￥：@item.Price</p>
                <p style="margin: 0px; color: red;">￥：@item.Current_Price</p>
                <span class="ui-li-count">销量：@item.Sale</span>
            </a>
        </li>
    }
</ul>
